using System;
using System.Collections.Generic;
using System.Dynamic;
using RimWorld;
using Verse;

namespace RimZombieGirl
{ 
    // 参考 Alert_TatteredApparel
    public class ZombieHungryAlert : Alert
    {


        // Token: 0x0601153E RID: 70974 RVA: 0x004F6786 File Offset: 0x004F4986
        public ZombieHungryAlert()
        {
            this.defaultLabel = "RI_Alert_ZombieHungry".Translate();
            this.defaultExplanation = "RI_Alert_ZombieHungryDesc".Translate();
            this.defaultPriority = AlertPriority.Medium;
        }

        public override AlertReport GetReport()
        {
            List<Pawn> zombiesHungry = new List<Pawn>();
            foreach (Pawn pawn in DeadNotDeadCache.cache.Keys)
            {
                if (pawn.Dead)
                {
                    continue;
                }
                if (pawn.needs?.food != null && pawn.needs.food.CurLevelPercentage < 0.2f)
                {
                    zombiesHungry.Add(pawn);
                }
                var gene = DeadNotDeadCache.cache[pawn];
                if (gene != null && gene.BloodPercent < 0.2f)
                {
                    zombiesHungry.Add(pawn);
                }

            }
            if (zombiesHungry.Count == 0)
            {
                return false;
            }
            return AlertReport.CulpritsAre(zombiesHungry);
        }
    }
}